package com.meilai.project.mapper.business.media;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.meilai.project.entity.media.MediaTypeSpec;
import com.meilai.project.entity.media.MediaTypeSpecExt;
import com.meilai.project.vo.business.media.MediaTypeSpecVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 点位类型规格 Mapper 接口
 * </p>
 *
 * @author xchen
 * @since 2022-05-24
 */
public interface MediaTypeSpecMapper extends BaseMapper<MediaTypeSpec> {


	List<MediaTypeSpecExt> listByCondition(Page<MediaTypeSpecExt> page, @Param("mediaTypeId") Long mediaTypeId, @Param("name") String name);

	List<MediaTypeSpecExt> listByMediaTypeId(@Param("mediaTypeId") Long mediaTypeId);

    List<MediaTypeSpecVO> allList();

    @Select("select vmtsp.media_type_spec_name from v_media_type_spec_price vmtsp " +
		    "JOIN media_type_spec mts on mts.id = vmtsp.media_type_spec_id " +
		    "where mts.media_type_id = 11 ")
    List<String> listDaPingSpec();

    @Select(" select DISTINCT CONCAT(size_width,'*',size_height) from media_point " +
		    " WHERE media_type_id = #{mediaTypeId} and `status` = 1")
    List<String> listMediaTypeSpec(@Param("mediaTypeId") Long mediaTypeId);
}
